<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:pe="http://primefaces.org/ui/extensions" >
<h:head>
	<title>Travel Package Participation</title>
</h:head>
<h:body>
	<h:link value="PERSONAL HOME" outcome="index" />
 	<h:form id="formDetail">
	<p:growl id="growl" />
	<p:panel id="panelDetailPackage" header="Participation">  
        <h:panelGrid columns="2">
			<h:outputLabel value="ID: "></h:outputLabel>
			<h:outputLabel id="id" value="#{participatePackage.travelPackage.id}" />
		
			<h:outputLabel value="Feasible reservations: "></h:outputLabel>
			<h:outputLabel id="feasibleReservations" value="#{participatePackage.travelPackage.feasibleReservations}" />
			
			<h:outputLabel for="start" value="Begin date: "></h:outputLabel>
			<p:outputLabel id="start" value="#{participatePackage.travelPackage.startTrip}" label="Start date" >
				<f:convertDateTime pattern="dd/MM/yyyy HH:mm" timeZone="GMT+1"/>
			</p:outputLabel>
			
			<h:outputLabel for="end" value="End date: "></h:outputLabel>
			<p:outputLabel id="end" value="#{participatePackage.travelPackage.endTrip}" label="End date" >
				<f:convertDateTime pattern="dd/MM/yyyy HH:mm" timeZone="GMT+1"/>
			</p:outputLabel>
			
			<h:outputLabel for="totalprice" value="Total price: "></h:outputLabel>
			<p:outputLabel id="totalprice" value="#{participatePackage.travelPackage.totalPrice}" label="Total price" />
			
			<h:outputLabel for="reservations" value="Reservations: "></h:outputLabel>
				<p:inputText id="reservations" value="#{participatePackage.reservations}"
					required="true" requiredMessage="Please enter the reservations." label="Reservations" >
				 	<p:slider for="reservations" minValue="1" maxValue="#{participatePackage.travelPackage.feasibleReservations}"/></p:inputText>
		</h:panelGrid>
		
		<p:commandButton id="buttonParticipatePackage" update="@form" value="Confirm participation"
			action="#{participatePackage.participateTravelPackage()}" />
	</p:panel>
	</h:form>
	
</h:body>
</html>